﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class TagsMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.Tag>
    {
        public TagsMap()
        {
            // table
            //ToTable("CMS_Tag");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.ModelId)
                
                .IsRequired();
            Property(t => t.TagName)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Counts)
                
                .IsOptional();
            Property(t => t.ViewCounts)
                
                .IsOptional();
            Property(t => t.UserId)
                
                .IsOptional();
            Property(t => t.Flag)
                
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

